<template>
  <div>test</div>
  {{ props.value }}
  <el-image style="width: 200px" :src="imgUrl"></el-image>
</template>

<script setup>
import { ref, watch } from 'vue'
const imgUrl = ref('')
const props = defineProps({
  val: {
    type: String,
    default: ''
  }
})

watch(
  () => props.val,
  () => {
    imgUrl.value = new URL(`../../../assets/images/${props.val}.jpg`, import.meta.url).href
  },
  { immediate: true }
)
</script>

<style lang="scss" scoped></style>
